package com.vecspace.datacenter.datatransform.service;

import com.vecspace.scheduler.job.AbstractJob;
import com.vecspace.statistics.counter.TimePeriodCounter;
import com.vecspace.web.servlet.model.Path;

/**
 * 
 * @author: wanghua
 */
public abstract class DataETL extends AbstractJob{
	protected final TimePeriodCounter readCounter = new TimePeriodCounter();
	protected final TimePeriodCounter writeCounter = new TimePeriodCounter();
	
	/**记录读取的记录行数
	 * @param rows 
	 * @author: wanghua
	 */
	public void readDataRows(int rows) {
		readCounter.add(rows);
	}
	
	/**记录写入（包括更新）的记录行数
	 * 
	 * @param rows 
	 * @author: wanghua
	 */
	public void writeDataRows(int rows) {
		writeCounter.add(rows);
	}

	/**读取的记录行数
	 * @return 
	 * @author: wanghua
	 */
	@Path("readCounter")
	public TimePeriodCounter getReadCounter() {
		return readCounter;
	}

	/**写入（包括更新）的记录行数
	 * @return 
	 * @author: wanghua
	 */
	@Path("writeCounter")
	public TimePeriodCounter getWriteCounter() {
		return writeCounter;
	}
}
